﻿using Ruandao.MiniAccess.SqlServer;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.IO;
namespace TestMiniAccess
{


    [TestClass()]
    public class SqlCommandFileTest
    {


        private TestContext testContextInstance;

        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        [TestMethod()]
        public void ExecuteCommandTest()
        {
            string file = Path.Combine(TestContext.TestDeploymentDir, "ResetData.xml");
            SqlCommandFile cmdFile = new SqlCommandFile(file);
            cmdFile.ExecuteCommand();
            Assert.AreEqual(5, DbUtility.GetRecordNumber(cmdFile.GetDatabase(), "Test"));
        }
    }
}
